<%@page import="com.nebula.util.FileUtil"%>
<%@page import="com.nebula.common.Const"%>
<%@page import="com.nebula.pojo.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%
	String order = "" , open = "";
	User user = (User)session.getAttribute(Const.USERINFO);
	if("普通用户".equals(user.getUserGroups().getGroupname())){
		order = "扩容至2T";
		open = "开通普通会员";
	}else if("普通会员".equals(user.getUserGroups().getGroupname())){
		order = "扩容至5T";
		open = "开通超级会员";
	}else{
		order = "";
		open = "";
	}
 %>

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<!--[if lt IE 9]>
<script type="text/javascript" src="static/html5shiv.js"></script>
<script type="text/javascript" src="static/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/footer.css" />
<!--[if IE 6]>
<script type="text/javascript" src="static/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>大岭山中学网盘</title>

<style type="text/css">
	.img {
		width: 30px;
		height: 30px;
	}
</style>

</head>
<body onload="usedSize();getCookie()">
<header class="navbar-wrapper">
	<div class="navbar navbar-fixed-top">
		<div class="container-fluid cl"> <a class="logo navbar-logo f-l mr-10 hidden-xs" style="font-size: 24px" href="/nebula/index.action" title="大岭山中学网盘"><img alt="大岭山中学" src="./static/image/dlszx.png" width="45px" height="45px">  大岭山中学网盘</a>
		<nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
			<ul class="cl">
				<li><img class="nav-user-photo img" src="static/avatars/user.jpg" alt="用户头像" /></li>
				<li class="dropDown dropDown_hover">
					<a href="#" class="dropDown_A"><%=user.getUsername()%>&nbsp;<i class="Hui-iconfont">&#xe6d5;</i></a>
					<ul class="dropDown-menu menu radius box-shadow">
						<li style="background: blue;">
						<img class="nav-user-photo img" src="static/avatars/user.jpg" alt="<%=user.getUsername()%>" /><%=user.getUsername()%>
						<br>
						<%
						if(!"普通用户".equals(user.getUserGroups().getGroupname())){
						%>
							<img src="static/image/vip.png" alt="vip" />&nbsp;
						<%
						}
						 %>
						<span><%=user.getUserGroups().getGroupname()%></span>
						</li>
						<li>
						<%
						if("超级会员".equals(user.getUserGroups().getGroupname())){
						%>
							<a href="javascript:;" class="disabled">永久超级会员</a>
						<%
						}else{
						%>
							<a href="javascript:;" id="member">开通超级会员</a>
						<%
						}
						%>
						</li>
						<li><a href="javascript:;" id="personalData">个人资料</a></li>
						<li><a href="javascript:;" id="myOrder">我的订单</a></li>
						<li><a href="javascript:;" id="changePwd">修改密码</a></li>
						<li><a href="javascript:;" id="logout">退出</a></li>
					</ul>
				</li>
				<li id="Hui-msg"> <a href="javascript:;" title="会员中心" id="member"><i class="Hui-iconfont" style="font-size:18px">&#xe6cc;</i></a> </li>
				<li id="Hui-skin" class="dropDown right dropDown_hover"> <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
					<ul class="dropDown-menu menu radius box-shadow">
						<li><a href="javascript:;" data-val="default" title="默认（蓝色）">默认（蓝色）</a></li>
						<li><a href="javascript:;" data-val="black" title="黑色">黑色</a></li>
						<li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
						<li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
						<li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
						<li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
					</ul>
				</li>
			</ul>
		</nav>
	</div>
</div>
</header>
<aside class="Hui-aside">
	<div class="menu_dropdown bk_2">
		<ul id="menu">
			<li class="current">
				<a data-href="fileAndFolder/list.action" data-title="全部文件" href="javascript:void(0)" title="全部文件">
					<i class="Hui-iconfont" style="font-size: 18px">&#xe687;</i> 全部文件
				</a>
			</li>
			<li>
				<a data-href="file/picture.action" data-title="图片" href="javascript:void(0)" title="图片">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;图片
				</a>
			</li>
			<li>
				<a data-href="file/document.action" data-title="文档" href="javascript:void(0)" title="文档">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文档
				</a>
			</li>
			<li>
				<a data-href="file/video.action" data-title="视频" href="javascript:void(0)" title="视频">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;视频
				</a>
			</li>
			<li>
				<a data-href="file/seeds.action" data-title="种子" href="javascript:void(0)" title="种子">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;种子
				</a>
			</li>
			<li>
				<a data-href="file/music.action" data-title="音乐" href="javascript:void(0)" title="音乐">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;音乐
				</a>
			</li>
			<li>
				<a data-href="file/other.action" data-title="其它" href="javascript:void(0)" title="其他">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其他
				</a>
			</li>
			<li>
				<a data-href="share/private.action" data-title="我的分享" href="javascript:void(0)" title="我的分享">
					<i class="Hui-iconfont" style="font-size: 18px">&#xe6aa;</i> 我的分享
				</a>
			</li>
			<li>
				<a data-href="friends/share.action" data-title="好友分享" href="javascript:void(0)" title="好友分享">
					<i class="Hui-iconfont" style="font-size: 18px">&#xe611;</i> 好友分享
				</a>
			</li>
			<li>
				<a data-href="share/public.action" data-title="公共分享" href="javascript:void(0)" title="公共分享">
					<i class="Hui-iconfont" style="font-size: 18px">&#xe6f1;</i> 公共分享
				</a>
			</li>
			<!-- <li>
				<a data-href="welcome.html" data-title="回收站" href="javascript:void(0)" title="回收站">
					<i class="Hui-iconfont" style="font-size: 18px">&#xe6e2;</i> 回收站
				</a>
			</li> -->
		</ul>
	</div>
	<div class="aside-footer">
		<div class="progress" style="margin-left: 15px">
			<div class="progress-bar">
				<span class="sr-only"></span>
			</div>
		</div>
		<div style="margin-left: 15px;margin-top: 3px">
			<span class="info" style="font-size: 12px">
			</span>
			<a id="member" style="font-size: 12px;color: #20b2aa;padding-left:20px;position: absolute;"><%=order%></a>
		</div>
	</div>
</aside>

<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<section class="Hui-article-box">
	<div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
		<div class="Hui-tabNav-wp">
			<ul id="min_title_list" class="acrossTab cl">
				<li class="active">
					<span title="全部文件" data-href="fileAndFolder/list.action">全部文件</span>
					<em></em></li>
			</ul>
		</div>
		<div class="Hui-tabNav-more btn-group"><a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d4;</i></a><a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d7;</i></a></div>
	</div>
	<div id="iframe_box" class="Hui-article">
		<div class="show_iframe">
			<div style="display:none" class="loading"></div>
			<iframe scrolling="yes" frameborder="0" src="fileAndFolder/list.action" id="iframe"></iframe>
	</div>
</div>
</section>

<div class="contextMenu" id="Huiadminmenu">
	<ul id="min_title_list">
		<li id="closethis">关闭当前 </li>
		<li id="closeall">关闭全部 </li>
	</ul>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/static/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.base64.js"></script>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="static/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript">
function getCookie(){
	var parentId = $.cookie("parentId");
	if(parentId){
		$("#iframe").attr("src","fileAndFolder/list.action?parentId="+$.base64.decode(parentId));
		$.cookie("parentId",'',{expires: -1,path:'/'});
	}else{
		$("#iframe").attr("src","fileAndFolder/list.action");
	}
}
/*个人信息*/
function myselfinfo(){
	layer.open({
		type: 1,
		area: ['300px','200px'],
		fix: false, //不固定
		maxmin: true,
		shade:0.4,
		title: '查看信息',
		content: '<div>管理员信息</div>'
	});
}
$(function(){
	$("#logout").click(function(){
		layer.confirm("<div style='text-align: center;padding: 25px 20px 20px'>确定要退出大岭山中学网盘吗？</div>",{title:"提示",area: ['427px','197px']},function(index){
			var i;
			$.ajax({
				type : "post",
				url : "/nebula/user/logout.action",
				success : function(data){
					window.location = "/nebula/login.jsp";
					$.cookie("exit","exit",{expires: 7,path: "/"});
					$.cookie("password",'',{expires: -1,path: "/"});
				}
			});
			layer.close(index);
		});
	});
})
</script> 
<script type="text/javascript">
$(function(){
    $("#menu li").click(function() {
        $(this).siblings('li').removeClass('current');  // 删除其他兄弟元素的样式
        $(this).addClass('current');// 添加当前元素的样式
    });
});
function usedSize(){
	$.ajax({
		type : "post",
		url : "/nebula/user/usedSize.action",
		data : {
			username : "<%=user.getUsername()%>"
		},
		dataType : "json",
		success : function(data){
			var percent = data.data['usedSize']/data.data['maxSize'] * 100;
			$(".aside-footer").find(".sr-only").attr("style","width:"+percent+"%");
			$(".aside-footer").find(".info").empty();
			$(".aside-footer").find(".info").append(data.data['USEDSIZE']+"/"+data.data['MAXSIZE']);
		}
	});
}

$("body").on("click","#agree",function(){
	var location , valid;
	$("iframe").each(function(i){
		if($(this).attr("src") == "friends/share.action"){
			location = i;
		}
	});
	valid = $(this).attr("class");
	$.ajax({
		url : "/nebula/friends/agree-application.action",
		data: {
			applicant : $(this).attr("class"),
		},
		dataType: "json",
		success : function(data){
			if(data.status == 0){
				$("iframe").eq(location).contents().find("#valid").val(valid);
				$("iframe").eq(location).contents().find(".header-tabs a").eq(1)[0].click();
				console.log($("iframe").eq(location).contents().find("#valid").val());
			}
			$(".layui-layer-setwin .layui-layer-close2").click();
		}
	});
});

$("body").on("click","#member",function(){
	layer.open({
		type: 2,
		area: ['550px','450px'],
		fix: false, //不固定
		shade:0.4,
		title: '开通会员',
		content: '/nebula/open-member.action'
	});
});

$("#changePwd").click(function(){
	layer.open({
		type: 2,
		area: ['550px','320px'],
		fix: false, //不固定
		shade:0.4,
		title: '修改密码',
		content: '/nebula/change-password.action'
	});
});

var winHeight = $(window).height();

$("#myOrder").click(function(){
	layer.open({
		type: 2,
		area: ['1000px',(winHeight - 50) +'px'],
		fix: false, //不固定
		shade:0.4,
		title: '我的订单',
		content: '/nebula/my-order.action'
	});
});

$(".disabled").click(function(){
	var type = '<%=user.getUserGroups().getGroupname()%>';
	layer.alert("尊敬的\"" + type + "\",您已拥有该系统最高权限,无需继续订购");
});

$("#personalData").click(function(){
	layer.open({
		type: 2,
		area: ['500px','500px'],
		fix: false, //不固定
		shade:0.4,
		title: '个人资料',
		content: '/nebula/personal-information.action'
	});
});

</script>
</body>
</html>